package service.myservice.login;

import java.util.HashMap;
import java.util.Map;

import service.vo.MessageVO;

public class LoginServiceImpl implements LoginService {

	@Override
	public Map<String, MessageVO> getVMessageVO(String name) {
		boolean b = this.isuser(name);
		MessageVO mv = new MessageVO();
		Map<String, MessageVO> map = new HashMap<String, MessageVO>();
		if (b == true) {
			mv.setMess("成功!");
			mv.setName(name);
			mv.setVal1("123");
			mv.setVal2("456");
			map.put("/view/Success.jsp", mv);
		} else {
			mv.setMess("失败!");
			mv.setName(name);
			mv.setVal1("abc");
			mv.setVal2("def");
			map.put("/view/Success.jsp", mv);
		}
		return map;
	}

	private boolean isuser(String name) {
		boolean b = false;
		if (name.equals("kyle")) {
			b = true;
		}
		return b;
	}

}
